package com.wcll.servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.SQLException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.wcll.bean.CQM_JianLi;

public class CQM_GongZuoServlet extends HttpServlet {

	
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		  response.setContentType("text/html; charset=UTF-8");
			request.setCharacterEncoding("UTF-8");

		   CQM_JianLi jianli=new CQM_JianLi(); 
		    String xuexiaoname=request.getParameter("xuexiaoname");
		    String zhuanyename=request.getParameter("zhuanyename");
		    String xueli=request.getParameter("xueli");
		    String waiyu=request.getParameter("waiyu");
		    String nengli=request.getParameter("nengli");
		    String jiangxiang=request.getParameter("jiangxiang");
		    String desc1=request.getParameter("desc1");
		    String shijianname=request.getParameter("shijianname");
		    String desc2=request.getParameter("desc2");
		     String  year=request.getParameter("year");
		     String month=request.getParameter("month");
		     String date=request.getParameter("date");
		     String date1=request.getParameter("date1");
		     String  year1=request.getParameter("year1");
		     String month1=request.getParameter("month1");
		     String date2=request.getParameter("date2");
		     String  year2=request.getParameter("year2");
		     String month2=request.getParameter("month2");
		     String date3=request.getParameter("date3");
		     String  year3=request.getParameter("year3");
		     String month3=request.getParameter("month3");
		     request.getSession().setAttribute("xuexiaoname", xuexiaoname);
		     request.getSession().setAttribute("zhuanyename", zhuanyename);
		     request.getSession().setAttribute("xueli", xueli);
		     request.getSession().setAttribute("waiyu", waiyu);
		     request.getSession().setAttribute("nengli", nengli);
		     request.getSession().setAttribute("jiangxiang", jiangxiang);
		     request.getSession().setAttribute("desc1", desc1);
		     request.getSession().setAttribute("shijianname", shijianname);
		     request.getSession().setAttribute("desc2", desc2);
		     request.getSession().setAttribute("year", year);
		     request.getSession().setAttribute("month", month);
		     request.getSession().setAttribute("date", date);
		     request.getSession().setAttribute("year1", year1);
		     request.getSession().setAttribute("month1", month1);
		     request.getSession().setAttribute("date1", date1);
		     request.getSession().setAttribute("year2", year2);
		     request.getSession().setAttribute("month2", month2);
		     request.getSession().setAttribute("date2", date2);
		     request.getSession().setAttribute("year3", year3);
		     request.getSession().setAttribute("month3", month3);
		
		     jianli.setXuexiaoname(xuexiaoname);
		     jianli.setZhuanyename(zhuanyename);
		     jianli.setXueli(xueli);
		     jianli.setWaiyu(waiyu);
		     jianli.setNengli(nengli);
		     jianli.setJiangxiang(jiangxiang);
		     jianli.setDesc1(desc1);
		     jianli.setShijianname(shijianname);
		     jianli.setDesc2(desc2);
		     jianli.setYear(year);
		     jianli.setMonth(month);
		     jianli.setDate(date);
		     jianli.setYear1(year1);
		     jianli.setMonth1(month1);
		     jianli.setDate1(date1);
		     jianli.setYear2(year2);
		     jianli.setMonth2(month2);
		     jianli.setDate2(date2);
		     jianli.setYear3(year3);
		     jianli.setMonth3(month3);
		     jianli.setDate3(date3);
		 String user1=(String)request.getSession().getAttribute("user1");
		 String bb=(String)request.getSession().getAttribute("loginname");
		 String f=(String)request.getSession().getAttribute("cishu");
		 try {
				jianli.gongJiao(jianli,user1,bb, f);
					
				this.getServletContext().getRequestDispatcher("/cqm_showJianLi.jsp")
				.forward(request, response);	
					
				
				
			} catch (SQLException e2) {
				// TODO Auto-generated catch block
				e2.printStackTrace();
			} catch (ClassNotFoundException e2) {
				// TODO Auto-generated catch block
				e2.printStackTrace();
			}
		    
		    
		    
		    
		    
	}

	/**
	 * Initialization of the servlet. <br>
	 *
	 * @throws ServletException if an error occurs
	 */
	public void init() throws ServletException {
		// Put your code here
	}

}
